package io.peng.j2se.lab;

/**
 * Created by eric on 16/3/15.
 */
public class MySingleton {
    private int balance = 0;

    private static class Loader {
        static MySingleton INSTANCE = new MySingleton();
    }

    private MySingleton () {}

    public static MySingleton getInstance() {
        return Loader.INSTANCE;
    }

    public void setBalance(int x) {
        this.balance = x;
    }

    public int getBalance() {
        return this.balance;
    }
}
